Total Complexity | 7 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | export class ModuleManager { |
||
2 | constructor() { |
||
3 | this.initCheckboxListener() |
||
4 | } |
||
5 | |||
6 | initCheckboxListener() { |
||
7 | $("input[type='checkbox'].module-activation").on('click', (event) => { |
||
8 | let element = event.currentTarget |
||
9 | let url = $("meta[name='module-activation-url']").attr('content') |
||
10 | |||
11 | $.post(url, { |
||
12 | _token: $("meta[name='csrf-token']").attr('content'), |
||
13 | src_module: $(element).data('module'), |
||
14 | active: $(element).is(':checked') === true ? '1' : '0' |
||
15 | }).then(() => { |
||
16 | let text = $(element).is(':checked') === true ? uctrans.trans('uccello::settings.module_manager.notification.module_activated') : uctrans.trans('uccello::settings.module_manager.notification.module_deactivated') |
||
|
|||
17 | M.toast({html: text}) |
||
18 | }) |
||
19 | .fail((error) => { |
||
20 | swal(uctrans.trans('uccello::default.dialog.error.title'), uctrans.trans('uccello::settings.module_manager.error.save'), 'error') |
||
21 | }) |
||
22 | }) |
||
23 | } |
||
24 | } |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.